<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<script>
(function(){
	
	var ztreesetting = {	
			view: {
				dblClickExpand: false,
				showLine: true,
				selectedMulti: false
			},
			callback: {
				onClick: zTreeOnClick
			},
			data: {
			simpleData: {
				enable:true,
				idKey: "cid",
				pIdKey: "cpid",
				rootPId: "0"
			},
			
	  }};
	//点击事件
	function zTreeOnClick(event, treeId, treeNode) {
		callbackTree1.click(event, treeId, treeNode); 
	};
	var callbackTree1={
			click:function(a,b,c){				//alert(1);
			}
	};
	//加载树
	 function loadTree(id,callbackTree){
		 $.ajax({
			   type: "POST",
			   url: "${pageContext.request.contextPath}/edu/sysClassAction.do?method=getAllClass&r="+Math.random(),				
			   dataType:"json",
			   async:false,
			   success: function(msg){  				  
				   $.fn.zTree.init($("#"+id), ztreesetting, msg[0].list);				   
				   callbackTree1 = callbackTree;
			   }
			}); 
	 }
	
	window.myjs={};
	window.myjs.loadTree=loadTree;
	
	
})();
</script>